# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=melkor
pkgver=1.0
pkgrel=2
groups=('blackarch' 'blackarch-fuzzer' 'blackarch-binary')
pkgdesc='An ELF fuzzer that mutates the existing data in an ELF sample given to create orcs (malformed ELFs), however, it does not change values randomly (dumb fuzzing), instead, it fuzzes certain metadata with semi-valid values through the use of fuzzing rules (knowledge base).'
arch=('x86_64')
url='http://packetstormsecurity.com/files/127924/Melkor-ELF-Fuzzer-1.0.html'
license=('GPL2')
depends=('java-environment')
source=("https://dl.packetstormsecurity.net/fuzzer/$pkgname-v$pkgver.tar.gz")
sha512sums=('2dd7504a94729a8f5b18cb51bcb35ff040e8a08ed4c89df00c9ae09fa76c882dc1f1efe3a424aee996489f773700080411f5d647bceacba6cdceb527bf56c394')

build() {
  cd "$pkgname-v$pkgver"

  make all
}

package() {
  cd "$pkgname-v$pkgver"

  install -dm 755 "$pkgdir/usr/bin"
  install -dm 755 "$pkgdir/usr/share/doc/$pkgname"

  cp -a docs/* "$pkgdir/usr/share/doc/$pkgname/"

  install -m 644 -t "$pkgdir/usr/share/doc/$pkgname/" AUTHOR.txt BUGS.txt \
    README.txt TODO.txt
  install -Dm 644 LICENSE.txt "$pkgdir/usr/share/licenses/$pkgname/LICENSE"

  make INSTALLPATH="$pkgdir/usr/bin/" install
}

